import http from '@/services/http';

export function getFilterList() {
  return http.get<Requestor.Response<Requestor.FilterResponse[]>>(
    '/api/admin/GoodsBase/open/filter/list',
  );
}

export function getList<T>(params: GoodsListManagementApi.ListParams) {
  return http.post<Requestor.ListResponse<T>>('/api/admin/GoodsBase/goods/list', {
    data: params,
  });
}
export function getInfo<T>(params: GoodsListManagementApi.InfoParams) {
  return http.get<Requestor.Response<T>>('/api/admin/GoodsBase/goods/info', {
    params,
  });
}
export function getSelledShopInfo<T>(params: GoodsListManagementApi.SelledShopInfoParams) {
  return http.get<Requestor.Response<T>>('/api/admin/GoodsBase/shop/selled', {
    params,
  });
}
export function create(params: GoodsListManagementApi.CreateParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/GoodsBase/create', {
    data: params,
  });
}
export function update(params: GoodsListManagementApi.UpdateParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/GoodsBase/update', {
    data: params,
  });
}
export function remove(params: GoodsListManagementApi.DeleteParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/GoodsBase/delete', {
    data: params,
  });
}
export function updateOnSelled(params: GoodsListManagementApi.OnSelledParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/GoodsBase/update/selled/on', {
    data: params,
  });
}
export function updateOffSelled(params: GoodsListManagementApi.OffSelledParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/GoodsBase/update/selled/off', {
    data: params,
  });
}
